<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <button id="btn">显示当前系统时间</button>
    <div id="time">某个时间</div>

    <script>
        // 获取按钮元素
        var btn = document.getElementById("btn");
        // 获取显示时间的元素
        var time = document.getElementById("time");


        // 绑定点击事件
        btn.onclick = function(){
            time.innerText = "<h1>测试修改元素内容</h1>"
            }
        btn.ondblclick = function(){
            time.innerHTML = "<h2>测试修改元素内容</h2>"
            }
    </script>
    
</body>
</html>